package com.decent.common.monitor.controller;

import com.decent.common.monitor.service.SystemMonitorService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 运维系统监控Controller
 *
 * @author fuyy
 * @author 2019/9/18 9:31
 */
@RestController
@RequestMapping("systemMonitor")
public class SystemMonitorController {
    @Resource
    private SystemMonitorService systemMonitorService;

    /**
     * 心跳监控
     * INSERT INTO tbl_system_monitor (monitor_key, monitor_value) VALUES ('heartBeatMonitor', 'normal');
     *
     * @return 数据库监控信息，正常返回：normal
     */
    @RequestMapping("monitor")
    public String monitor() {
        return systemMonitorService.monitor();
    }
}
